$(document).ready(function(){
    format_currency();
    openBirthDate();
    set_auto_width_content();
});
function set_auto_width_content(){
    $.each($('.main_content_head'),function(){
        var x_width = 50;
        var main_content_width = $('.main_content').width();
        var w_width = $(this).children('.main_content_head_tab_content').width();
        var right_middle_width = main_content_width - (w_width + x_width);
        $(this).children('.main_content_head_tab_right_middle').width(right_middle_width);
    });
    if($.browser.mozilla)
        $('div.menu ul.navi_item li:last-child').width(357);
}
function format_currency(){
    $('.currency').blur(function(){
        $(this).formatCurrency();
    });
}
function openBirthDate(){
    var day = new Date();
    c_year = day.getFullYear();
    $('#birthdate').datePicker({startDate:'01/01/' + (c_year - 100),endDate: (new Date()).asString(), clickInput:true});
}
function replaceAll(strTarget,strSubstring,strReplace){
    var indexTarget = strTarget.indexOf(strSubstring);
    while(indexTarget != -1){
        strTarget = strTarget.replace(strSubstring,strReplace);
        indexTarget = strTarget.indexOf(strSubstring);
    }
    return strTarget;
}